#!/usr/bin/perl
#This function extracts the required line of the output where the loss percentage is mentioned.
sub get_op_line{                                              #This is the subroutine for getting the proper line of output from the whole output.
	my(@complete_output) = @_;
	$local_flag = 0;
	foreach $local_var (@complete_output){
		if ($local_var =~/received/){
			$reqd_line = $local_var;              #arr1 has the output line which contains % of packets lost.
			$local_flag = 1;
		}
		if ($local_flag == 1){
			break;
		}
	}
	@split_line = split(' ',$reqd_line);
	return($reqd_line,@split_line);                       #$reqd_line maps to $reqd_op_line ---- @split_line maps to @reqd_op_line_split.
}
1;
